/* This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The Fuck You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */ 
package de.rockon.fuzzy.controller.gui.ruleeditor;

import java.awt.Component;

import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import javax.swing.SwingConstants;

public class TableBooleanCellEditor extends DefaultCellEditor {
	private static final long serialVersionUID = 7830249305858209824L;

	public TableBooleanCellEditor() {
		super(new JCheckBox());
	}

	@Override
	public Component getTableCellEditorComponent(final JTable table, final Object value, final boolean isSelected, final int row,
			final int column) {
		final JCheckBox box = (JCheckBox) super.getTableCellEditorComponent(table, value, isSelected, row, column);
		box.setHorizontalAlignment(SwingConstants.CENTER);
		return box;
	}
}